﻿
@model XQ.SP.Model.UserInfoItem
@{
    ViewBag.Title = "用户数据权限 信息";
    ViewBag.TextName = "用户数据权限 信息";
    Layout = "~/Views/Shared/Admin.cshtml";
}
<link rel="stylesheet" type="text/css" href="/Res/CSS/css/base.css" />
<link rel="stylesheet" type="text/css" href="/Res/CSS/css/styles.css" />

<div class="breadcrumb">
	<div class="route fl">
		<a href="/UserInfo/List">管理列表</a> 
		<i>&gt;</i>
		<span>信息编辑</span> 
	</div>
</div>

<form id="frmPwd" action="/UserInfo/Pwd" method="post" onsubmit="return toVaild()">
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.Status)
        @Html.HiddenFor(model => model.Created)
        @Html.HiddenFor(model => model.Creator)
        @Html.HiddenFor(model => model.Modifier)
        @Html.HiddenFor(model => model.Modified)
    @{
        List<SelectListItem> ListSeach = new List<SelectListItem>();        
    }
<div style=" font-size: 22px; color: red; margin-top:15px; text-align: center; width: 100%;">@Html.ValidationSummary(true)</div>
<div class="pd15">

    <div class="form-item">
		<label class="form-label">用户 名</label>
		<div class="input-block"><input type="text" id="UserName" name="UserName"  value="@Model.UserName" class="input" placeholder="请输入用户 名" /></div>
	</div>
    <div class="form-item">
        <label class="form-label">原密码</label>
        <div class="input-block"><input type="password" id="oldPwd" old="@Model.Pwd" class="input" placeholder="请输入密码" /></div>
    </div>
    <div class="form-item">
        <label class="form-label">新密码</label>
        <div class="input-block"><input type="password" id="newPwd" class="input" placeholder="请输入密码" /></div>
    </div>
    <div class="form-item">
		<label class="form-label">确认密码</label>
		<div class="input-block"><input type="password" id="Pwd" name="Pwd"  value="" class="input" placeholder="请输入密码" /></div>
	</div>
    <div class="form-item">
		<label class="form-label">县市</label>
		<div class="input-block"><input type="text" readonly="readonly" id="City" name="City"  value="@Model.City" class="input" placeholder="请输入县市" /></div>
	</div>
    <div class="form-item">
		<label class="form-label">乡镇</label>
		<div class="input-block"><input type="text" readonly="readonly" id="Towns" name="Towns" value="@Model.Towns" class="input" placeholder="请输入乡镇" /></div>
	</div>
    <div class="form-item">
		<label class="form-label">村名称</label>
		<div class="input-block"><input type="text" readonly="readonly" id="Village" name="Village" value="@Model.Village" class="input" placeholder="请输入村名称" /></div>
	</div>
    
<div class="form-item">
		<div class="input-block">
			<button type="submit" class="btn btn-large" id="btn-publish">立即保存</button>
		</div>
	</div>
</div>
</form>
<script type="text/javascript" src="/Res/CSS/js/jquery.js"></script>
<script type="text/javascript" src="/Res/CSS/js/jquery-form.js"></script>
<script>
    $(function () {
        $('#frmPwd').ajaxForm(function (data) {
            alert(data.result.msg);
        });
    })
    function toVaild() {
        var userName = document.getElementById("UserName");
        if (!userName.value) {
            alert("用户名不能为空");
            return false;
        }

        var oldPwd = document.getElementById("oldPwd");
        if (oldPwd.value != oldPwd.getAttribute("old")) {
            alert("您的原始密码错误");
            return false;
        }
        var newPwd = document.getElementById("newPwd"),
            pwd = document.getElementById("Pwd");
        if (newPwd.value != pwd.value) {
            alert("两次密码不一致");
            return false;
        }

        return true;
    }
    function US(data) {
        var nme = data.substr(data.lastIndexOf("|") + 1);
        var path = data.substr(0, data.lastIndexOf("|"));
        if (nme.length > 0 & data.lastIndexOf("||") < 0) {
            try {
                document.getElementById(nme + "1").src = path;
            } catch (e) { }
            try {
                document.getElementById(nme).value = path;
            } catch (e) { }
            try {
                document.getElementById(nme + "N").innerHTML = path.substr(path.lastIndexOf("/") + 1);
            } catch (e) { }
        }
    }
</script>



